package com.lingang.common.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * @author hj
 * @date 2025年05月30日 18:22
 */
public enum BooleanEnum {
    FALSE(false, 0),
    TRUE(true, 1);

    @Getter
    private final boolean isTure;

    @Getter
    private final int intValue;

    BooleanEnum(boolean isTure, int intValue) {
        this.isTure = isTure;
        this.intValue = intValue;
    }

    public static BooleanEnum valueOf(Integer intValue) {
        return Arrays.stream(values())
                .filter(each -> Objects.equals(each.getIntValue(), intValue))
                .findAny()
                .orElse(BooleanEnum.FALSE);
    }
}
